package com.test2015.util.unzipTest;

public class MonitorThread implements Runnable {
	public static boolean isFinish = false;
	private String nowSchedule = "";
	private String newSchedule = "";
	
	public void run() {
		try {
			while(!isFinish){
				nowSchedule = getSchedule();
				Thread.sleep(100);
			}
			if(!nowSchedule.equals("success!") && !nowSchedule.equals("failed!")){
				getSchedule();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public String getSchedule(){
		
		newSchedule = UnzipFileTest.schedule;
		if(!newSchedule.equals(nowSchedule)){
			System.out.println(newSchedule);
			nowSchedule = newSchedule;
		}
		
		return nowSchedule;
	}
}
